package com.hori3d.rc;

import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.app.ProgressDialog;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.content.pm.ActivityInfo;
import android.graphics.Color;
import android.graphics.drawable.AnimationDrawable;
import android.os.Bundle;
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
import android.os.StrictMode;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.view.ViewPager;
import android.util.Log;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;

import com.hori3d.rc.R.id;
import com.hori3d.rc.bean.Printer;
import com.hori3d.rc.service.ConnectPrinterService;
import com.hori3d.rc.service.ConnectPrinterService.LocalBinder;
import com.shizhefei.view.indicator.FragmentListPageAdapter;
import com.shizhefei.view.indicator.IndicatorViewPager;
import com.shizhefei.view.indicator.ScrollIndicatorView;
import com.shizhefei.view.indicator.IndicatorViewPager.IndicatorFragmentPagerAdapter;
import com.shizhefei.view.indicator.slidebar.ColorBar;
import com.shizhefei.view.indicator.transition.OnTransitionTextListener;



public class TestActivity extends BaseActivity {

	private TextView tv;
    Timer timer;
    Printer p=App.ctx.getPrinter();;
    

    private   Handler mHandler = new Handler(){ 
   	    @Override
   	    public void handleMessage(Message msg)
   	    {
   	    	String info="喷头1温度		"+p.getTemp1()
		    + "\n喷头2目标温度	"+p.getTemp1Target()
			+"\n喷头2温度	"+p.getTemp2()
			+ "\n喷头2目标温度	"+p.getTemp2Target()
		
			+ "\n热床温度	"+p.getTempBed()
			+ "\n热床目标温度	"+p.getTempBedTarget()
			+ "\n打印速度	"+p.getSpeedPrint()
			+ "\n出料速度	"+p.getSpeedMaterial()
			+ "\n风扇速度	"+p.getSpeedFans()
			+ "\n是否自动关机	"+p.isAutoPowerOff()
		    +"\n打印状态		"+p.getPrinterStatusCode()
			+"\n打印进度		"+p.getPrintingProcess()
			+ "\n打印时间	"+p.getPrintingTime()
			+ "\n打印文件	"+p.getPrintingFile();
		    
		   

tv.setText(info);
   	    }
   	};     
    
    
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
	     setContentView(R.layout.test1);
	     tv=(TextView) findViewById(id.tv_info);
	    
	
	
	     
	     
	timer=new Timer();
	timer.schedule(new TimerTask() {
		
		@Override
		public void run() {
			mHandler.sendEmptyMessage(23132);
		}
	}, 0,1000);
 
	}
}